package com.heima.controller;


import cn.hutool.core.bean.BeanUtil;
import com.heima.pojo.Business;
import com.heima.pojo.vo.BusinessVo;
import com.heima.service.IBusinessService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * 商圈表 前端控制器
 *
 * @author xjy
 * @since 2024-06-06
 */
@RestController
@RequestMapping("/vm-service/businessType")
@Api(tags = "商圈管理")
public class BusinessController {
    @Autowired
    private IBusinessService businessService;

    @GetMapping
    @ApiOperation("查询商圈列表")
    public List<BusinessVo> findAll() {
        List<Business> list = businessService.list();
        return BeanUtil.copyToList(list, BusinessVo.class);
    }
}
